<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
						   <li>
								审核状态：
								<select id="checkState" name="checkState">
								<option label="所有" value=""/>
								<option label="未审核" value="0"/>
								<option label="审核通过" value="1"/>
								<option label="审核未通过" value="2"/>
								</select>
								<a></a>
							</li>
							<li>
								入库时间：
								<select id="time" name="time">
								<option label="所有" value=""/>
								<option label="今日" value="1"/>
								<option label="昨日" value="2"/>
								<option label="近七天" value="3"/>
								<option label="近一个月" value="4"/>
								</select>
							</li>
							<li>
								关键字：<input type="text" name="key"/>
							</li>

						<!--  	<li>
								：<input type="text" name="delFlag"/>
							</li>   -->

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				
				
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="gxgw_modules:input:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="gxgw_modules:input:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('gxgw_modules:input:edit')}]];
        var removeFlag = [[${@permission.hasPermi('gxgw_modules:input:remove')}]];
        var prefix = ctx + "gxgw_modules/input";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "商品入库",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'inputId', 
					title : '序号',
					visible: false
				},
				{
					field : 'goodsName', 
					title : '商品名称',
					sortable: true
				},
				{
					field : 'goodsBar', 
					title : '商品条码',
					sortable: true
				},
				{
					field : 'inputNum',  
					title : '入库数量',
					sortable: true
				},
				{
					field : 'inputTime', 
					title : '入库时间',
					sortable: true
				},
				{
					field : 'adminNick', 
					title : '操作员',
					sortable: true
				},
				{
					field : 'checkName', 
					title : '审核人',
					sortable: true
				},
				{
					field : 'checkTime', 
					title : '审核时间',
					sortable: true
				},
				{
					field : 'checkState', 
					title : '审核状态',
					sortable: true,
					formatter: function (value) {
						switch (value) {
							case 0:
								return '未审核'
							case 1:
								return '审核通过'
							case 2:
								return '审核不通过'
							
						}
					}
				},
				{
					field : 'remark', 
					title : '备注',
					sortable: true
				},
				
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.inputId + '\')"><i class="fa fa-edit"></i>审核</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.inputId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
            $('select#checkState').change(function(){
            	$.table.search();
                });
            $('select#time').change(function(){
            	$.table.search();
                });
        });
    </script>
</body>
</html>